package org.dreamfly.core.util;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Gin
 * Date: 2010-11-23
 * Time: 14:14:28
 * To change this template use File | Settings | File Templates.
 */
public class MakeTypeIdList {

    public static List<Long> divide(String target){
        List<Long> longs = new ArrayList<Long>();
        if(null != target){
        String[] result = target.split(",");
        for(String temp : result){
            if("".equals(temp)){
                break;
            }else{
                Long aLong = new Long(temp);
                longs.add(aLong);
            }
        }
        return longs;
        }else{
            return null;
        }
    }

    public static String combine(List<Long> szTypeIds){
        String result = "";
        if(null != szTypeIds&&0 != szTypeIds.size()){
        for(Long id : szTypeIds){
            if(null != id)
            result += id.toString() + ",";
        }
        }
        return result;
    }
}
